-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Degree list #244
Degree list #244
Conversation
i didnt do anything w weighted degree for now. |
R/constructors-Node.R
Outdated
setMethod("Node", "numeric", function(id, x = numeric(), y = numeric(), color = NULL, weight = NULL) { | ||
new("Node", id = NodeId(as.character(id)), x = x, y = y, color = color, weight = weight) | ||
setMethod("Node", "numeric", function(id, x = numeric(), y = numeric(), color = NULL, weight = NULL, degree = NULL) { | ||
degree <- ifelse(is.null(degree), 0, degree) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
degree should be null until it's set to something. degree = 0 says we actually know something about this node in the network
) | ||
nodeC <- Node( | ||
id = NodeId('C') | ||
id = NodeId('C'), | ||
degree = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think the degree should allowed to be set when creating a node. The degree is not a thing outside of the network context. First, I could have nodeA in network1 and network2. There's no reason nodeA should have the same degree in both.
Second, i could set it wrong. Why would i know that nodeA will have two links when i haven't made the edge list yet? These degrees aren't connected to the edge list at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if i just dont export it from the package, and it can only ever be used internally? i dont see why, if you have an edgeList in hand, you shouldnt be able to create the node already knowing the degree. but i agree random people shouldnt make random nodes w random values for degree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think id even be happy if the only thing we actually did export were the edgeList based constructors, particularly for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense to me!
Idk where my review button went but anyways
|
resolves #239